<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img
        class="banner-img"
        src="http://img1.qunarzz.com/sight/p0/1801/fa/fa32008fee2ce56ca3.img.jpg_600x330_8f899763.jpg"
      />
      <div class="banner-info">
        <div class="banner-title">万海海洋世界</div>
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe604;</span>
          6
        </div>
      </div>
    </div>
    <common-gallary @close="handleGallaryClose" v-show="showGallary" :imgs="imgs"></common-gallary>
  </div>
</template>
<script>
import CommonGallary from "common/gallary/Gallary";
export default {
  name: "DetailBanner",
  data() {
    return {
      showGallary: false,
      imgs: [
        "http://img1.qunarzz.com/sight/p0/201301/14/bf26ff3662c7a2a393835fbb.png_350x240_becac661.png",
        "http://img1.qunarzz.com/sight/p0/201301/14/bf26ff3662c7a2a393835fbb.png_350x240_becac661.png"
      ]
    };
  },
  methods: {
    //<common-gallary @close="handleGallaryClose" v-show="showGallary"
    // :imgs="imgs"></common-gallary>

    handleBannerClick() {
      this.showGallary = true;
    },
    handleGallaryClose() {
      this.showGallary = false;
    }
  },
  components: {
    CommonGallary
  }
};
</script>
<style lang='stylus' scoped>
.banner {
  overflow: hidden;
  height: 0;
  padding-bottom: 55%;
  position: relative;

  .banner-img {
    width: 100%;
  }

  .banner-info {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    line-height: 0.6rem;
    color: #fff;
    background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));

    .banner-title {
      padding: 0 0.2rem;
      flex: 1;
      font-size: 0.36rem;
    }

    .banner-number {
      padding: 0 0.4rem;
      line-height: 0.32rem;
      height: 0.32rem;
      border-radius: 0.2rem;
      background: rgba(0, 0, 0, 0.8);
      font-size: 0.24rem;

      .banner-icon {
        font-size: 0.24;
      }
    }
  }
}
</style>